package com.songlanyun.modules.gains.service;

import com.songlanyun.common.drive.IBaseService;
import com.songlanyun.common.enums.ShopGainsConstant;
import com.songlanyun.modules.gains.entity.ShopOrderGains;
import com.songlanyun.modules.order.entity.ChildOrder;
import com.songlanyun.modules.order.entity.Order;
import com.songlanyun.modules.rights.entity.RightsChildOrder;
import com.songlanyun.modules.rights.entity.RightsOrder;

import java.math.BigDecimal;

/**
 * 商家销售商品所得表
 *
 * @author lubo
 * @email sunlightcs@gmail.com
 * @date 2020-12-03 11:03:16
 */
public interface ShopOrderGainsService extends IBaseService<Long,ShopOrderGains> {

    /**
     * 支付成功计算商家所得
     * @param order
     * @return
     */
    void initCreate(Order order);

    /**
     * 退款完成计算商家所得，同时入帐
     * @param rightsOrder
     * @return
     */
    void refund(RightsOrder rightsOrder);

    BigDecimal waitInBill(Long shopId);

    /**
     * 根据子订单，结算消费订单商家所得
     * @param childOrder
     * @return
     */
    ShopOrderGains settlementByChildOrder(ChildOrder childOrder);


    /**
     * 根据子订单，结算服务订单商家所得
     * @param childOrder
     * @return
     */
    ShopOrderGains settlementServiceGoodsByChildOrder(ChildOrder childOrder);


    ShopOrderGains loadByShopIdAndOrderAndGoodsType(Long shopId, Long orderId, Long childOrderId, ShopGainsConstant.GoodsType goodsType);


    //发放没有给奖励的订单
    void clearOrderGainsData();



}

